<%--
  Created by IntelliJ IDEA.
  User: sky
  Date: 17/5/10
  Time: 16:39
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<div class="header">
    <div class="header-content">
        <div class="logo clearfix">
            <img src="/assets/images/logo-write.png" alt="logo">
            <div>后台管理系统</div>
            <span>V2.0</span>
        </div>
        <div class="user-detail">
            <div>
                <span class="current-user">当前用户</span>
                <span class="user-name">
                        <%=session.getAttribute("realName")%>
                    </span>
            </div>
            <div class="header-line"></div>
            <div class="header-data" id="current_time">载入中...</div>
        </div>
        <div class="login-out"><a href="/logout">注销</a></div>
    </div>
</div>
<script type="text/javascript">
    //document.getElementById("cur_user_name").innerHTML="用户为:"+curDay;
    <%--显示时间--%>
    function timer() {
        var curDay = new Date().Format("yyyy年MM月dd日 hh:mm:ss");
        document.getElementById("current_time").innerHTML = curDay;
    }
    setInterval("timer()", 1000);      //每秒刷新一次
    Date.prototype.Format = function (fmt) { //author: meizz
        var o = {
            "M+": this.getMonth() + 1, //月份
            "d+": this.getDate(), //日
            "h+": this.getHours(), //小时
            "m+": this.getMinutes(), //分
            "s+": this.getSeconds(), //秒
            "q+": Math.floor((this.getMonth() + 3) / 3), //季度
            "S": this.getMilliseconds() //毫秒
        };
        if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
        for (var k in o)
            if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
        return fmt;
    }

</script>